<template>
	<div class="endLive">
		<div class="endLiveCont">
			<div class="bjImg">
				<image src="@/static/image/user/bj.png" mode="" class=""></image>
			</div>

			<div class="endLiveCenter">
				<div class="endLiveCont_back" @click="backBtn()">
					<image src="@/static/image/left.png" mode="" class="endLiveCont_back_img"></image> <span>编辑直播</span>

					<!-- <div class="useLable">
						<image src="@/static/image/hex.png" mode="">
							用户标签
					</div> -->
				</div>
			</div>
	 
			<!-- content -->

		</div>


	</div>
</template>

<script>
 
	export default {
	 
		filters: {
			formatDate(v) {
				if (v == 0) {
					return '-'
				}
				const value = v * 1000
				const data = new Date(value);
				const month = data.getMonth() + 1;
				const day = data.getDate();
				const year = data.getFullYear();
				const hours = data.getHours();
				const minutes = data.getMinutes();
				const seconds = data.getSeconds();
				const formattedTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
				return formattedTime;
			},
		},
		data() {
			return {
				params: {
					customerId: '1803713742077173760',
				},
				liveId:'1806144274538962944',
				loading: false,
				tagList: [],
				from: {
					name: ''
				},
				isMask: false,
				eitFrom: {},
				userTabList: [{
					name: '直播信息',
					status: '0'
				}, {
					name: '基础设置',
					status: '1'

				}, {
					name: '观看限制',
					status: '2'
				}, {
					name: '分享设置',
					status: '3'
				}, {
					name: '观看页设置',
					status: '4'
				}],
				liveIndex: 2,
				setInfo:{
					
				}
			}
		},
		onPullDownRefresh() {
			this.params.page = 1
			this.tagList = []
			this.loading = false
			this.getTagList()
		},
		onLoad(opt) {
			if (opt.liveId) {
				this.params.liveId = opt.liveId || '1803713742077173760'
			}
			this.getTagList() //获取用户详情
		},
		methods: {
		 
			tabChange(e) {
				this.liveIndex = e.status
			},
			// 关闭新增编辑弹窗
			backMaskEvent() {
				this.isMask = false
				this.params.page = 1
				this.tagList = []
				this.loading = false
				this.getTagList()
			},
			// 编辑
			eitEvent(ite) {
				this.eitFrom = ite
				this.isMask = true
			},
			backBtn() {
				uni.navigateBack()
			},
			scrolltolower(e) {
				if (this.tagList.length < this.total) {
					this.params.page++
					this.getRedPacket()
				} else {
					uni.showToast({
						title: '已到底',
						icon: 'none'
					})
				}
				console.log('e.detail.scrollTop', e.detail.scrollTop)
			},
			// getTagList
			async getTagList() {
				const {
					data
				} = await this.$request(this.$Api.tagList, {
					name: this.from.name
				}, "get")
				this.loading = true
				if (data.code != 200) return
				uni.stopPullDownRefresh()
				if (!data.data) return
				this.tagList = data.data.list
			},
			// 搜索
			couponEvent() {
				this.params.page = 1
				this.tagList = []
				this.loading = false
				this.getTagList()
			},
			backCloseEvent() {
				this.isMask = false
			},
			addTagEvent() {
				this.isMask = true
				this.eitFrom = {}
			},
			// 删除后不可恢复，不可查看活动信息，是否要删除活动
			deleteEvent(ite, idx) {
				uni.showModal({
					title: '提示',
					content: '删除后将同步删除已贴的标签，您确定删除该标签吗？',
					success: async (res) => {
						console.log('res', res)
						if (res.confirm) {
							const {
								data
							} = await this.$request(this.$Api.tagDelete, {
								tagId: ite.tagId
							}, "POST")
							if (data.code !== 200) return
							// 执行软删除
							this.tagList.splice(idx, 1)
							uni.showToast({
								title: '操作成功',
								icon: 'none'
							})
						}
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	.endLive {
		width: 100%;
		padding: 0 !important;
		margin: 0 !important;
		height: 100vh;
		overflow: hidden;
		background: #FAFBFF !important;
		padding-bottom: 320rpx;
	}
 
	.userTagBtn {
		width: 750rpx;
		height: 166rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(210, 210, 210, 0.5);
		position: fixed;
		left: 0;
		bottom: 0;
		display: flex;
		align-items: center;
		justify-content: center;

		.userTagBtn_text {
			width: 640rpx;
			height: 80rpx;
			background: #295FFF;
			box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(210, 210, 210, 0.5);
			border-radius: 40rpx;
			font-size: 32rpx;
			color: #fff;
			text-align: center;
			line-height: 80rpx;
		}

	}





	.endLiveCont {
		width: 100%;
		// height: 100vh;
		position: relative;
		padding: 30rpx 0;
		box-sizing: border-box;
		color: #fff;
		// overflow-y: scroll;



		.endLiveCenter {
			width: 100%;
			position: absolute;
			left: 0;
			top: 0;
			padding: 30rpx 0;
			box-sizing: border-box;
			overflow-y: scroll;
			z-index: 2;

		}

		.bjImg {
			width: 100%;
			min-height: 1628rpx;
			position: absolute;
			left: 0;
			top: 0;
			background: #FAFBFF;
			z-index: 1;

			image {
				width: 100%;
				height: 100%;
				position: absolute;
				left: 0;
				top: 0;
			}
		}

		.endLiveCont_back {
			width: 100%;
			height: 80rpx;
			float: left;
			position: relative;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.endLiveCont_back_img {
				width: 58rpx;
				height: 58rpx;
				float: left;
				position: absolute;
				top: 10rpx;
			}

			span {
				font-size: 28rpx;
				margin-left: 72rpx;
				color: #1D2129;
				line-height: 80rpx;
			}

			.useLable {
				display: flex;
				align-items: center;
				justify-content: space-between;
				width: 172rpx;
				height: 48rpx;
				border-radius: 24rpx;
				border: 2rpx solid #295EFF;
				margin-right: 32rpx;
				padding: 0 18rpx;
				box-sizing: border-box;
				color: #295EFF;
				font-size: 24rpx;
				line-height: 44rpx;

				image {
					width: 24rpx;
					height: 24rpx;
				}
			}
		}



	}
</style>